import request from '@/utils/request'

// 获取权限列表
export const getPermissionList = params => request({
  url: '/permissions',
  method: 'get',
  params
})

// 删除权限
export const delPermissionList = id => request({
  url: '/permissions/' + id,
  method: 'delete'
})

// 增加权限
export const addPermissionList = data => request({
  url: '/permissions',
  method: 'post',
  data
})

// 获取权限数量
export const getTotal = () => request({
  url: '/permissions/count',
  method: 'get'
})

// 编辑权限
export const updatePermissionList = (data) => request({
  url: '/permissions/' + data.id,
  method: 'put',
  data
})

// 获取指定权限
export const getPermission = id => request({
  url: '/permissions/' + id,
  method: 'get'
})
